﻿<Frame x:Class="StockManagement.Views.MaterialsPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
       xmlns:views="clr-namespace:StockManagement.Views"
       NavigationUIVisibility="Hidden"
      mc:Ignorable="d" d:DesignHeight="321" d:DesignWidth="406">
    <Frame.Background>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF6E46AD" Offset="1"/>
            <GradientStop Color="#FF7BBCE5" Offset="0.53"/>
            <GradientStop Color="#FFFBFBFB" Offset="0.004"/>
        </LinearGradientBrush>
    </Frame.Background>
    <Frame.Content>
        <Grid x:Name="_mainGrid">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.35*"></ColumnDefinition>
                <ColumnDefinition Width="0.65*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <ScrollViewer VerticalScrollBarVisibility="Auto">
                <StackPanel CanVerticallyScroll="True">
                    <GroupBox  Margin="5" Header="Add/Edit Material" VerticalAlignment="Top" HorizontalContentAlignment="Stretch">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"></RowDefinition>
                                <RowDefinition Height="*"></RowDefinition>
                            </Grid.RowDefinitions>
                            <StackPanel Orientation="Horizontal" Grid.ColumnSpan="3">
                                <RadioButton x:Name="rdAddProduct" Content="Add Material" GroupName="addedit" Margin="5" Padding="3" Checked="rdAddProduct_Checked" VerticalContentAlignment="Center"></RadioButton>
                                <RadioButton Content="Inward Material" GroupName="addedit" Margin="5" Padding="3" Checked="rdAddProduct_Checked" VerticalContentAlignment="Center"></RadioButton>
                            </StackPanel>
                            <Frame x:Name="addeditFrame" Grid.Row="1"></Frame>
                        </Grid>
                    </GroupBox>

                    <GroupBox Margin="5" Padding="3" Header="Outward Material" VerticalAlignment="Top">
                        <views:OutwardMaterial  DataContext="{Binding Path=OutwardMaterialVM}"></views:OutwardMaterial>
                    </GroupBox>
                </StackPanel>
            </ScrollViewer>
            <GridSplitter Grid.RowSpan="5"  Width="3" VerticalAlignment="Stretch" Background="{StaticResource HeaderBorderBrush}"></GridSplitter>
            
            <views:MaterialGrid x:Name="_dgMaterials" Grid.Column="1" Grid.RowSpan="3"></views:MaterialGrid>
        </Grid>
    </Frame.Content>
</Frame>